import {defineStore} from "pinia";
import type {CacheSendState} from "@/types";

export const useCacheSendStore = defineStore('cacheSend',{
	state: (): CacheSendState => ({
		msg : null,
		mode : null,
		linkNet : false,
		// uploadType : -1, //-1还没开始选 0图片、1文档、2语音音频,
		// uploadList : [],
	}),
	actions: {
		clean() {
			this.$reset()
		},
		setCache(data:CacheSendState) {
			this.msg = data.msg||null
			this.mode = data.mode||null
			this.linkNet = data.linkNet||false
			if(data.uploadType)	this.uploadType = data.uploadType
			if(data.uploadList)	this.uploadList = data.uploadList
		},
	}

})